package com.vhall.component.entity.rebroadcast;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 领取红包记录表
 * red_packet_records
 */
@Data
@TableName("red_packet_record")
public class RedPacketRecordEntity implements Serializable {
    /**
     * 获得红包记录ID（主键）
     *
     * @date 2021-02-25 10:27:54
     */
    @TableId(type = IdType.AUTO, value = "id")
    @JsonProperty(value = "id")
    private Long id;

    /**
     * 红包ID
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("red_packet_id")
    @JsonProperty(value = "red_packet_id")
    private Long redPacketId;

    @TableField("red_packet_uuid")
    @JsonProperty(value = "red_packet_uuid")
    private String redPacketUuid;

    @TableField("app_id")
    @JsonProperty(value = "app_id")
    private String appId;

    /**
     * 领取红包的第三方用户ID
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("user_id")
    @JsonProperty(value = "user_id")
    private Integer userId;

    /**
     * 房间编号
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("room_id")
    @JsonProperty(value = "room_id")
    private String roomId;

    /**
     * 领取的红包金额
     *
     * @date 2021-02-25 10:27:54
     */
    private BigDecimal amount;

    /**
     * 领取的红包金额大小排名
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("amount_ranking")
    @JsonProperty(value = "amount_ranking")
    private Integer amountRanking;

    /**
     * 超过百分比
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("`percent`")
    private Integer percent;

    /**
     * 发送表情类型：1.红包，2.礼品
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("gift_type")
    @JsonProperty(value = "gift_type")
    private Integer giftType;

    /**
     * 自定义扩展字段
     *
     * @date 2021-02-25 10:27:54
     */
    private String extension;

    /**
     * 是否已删除 0 表示未删除 1 表示已删除
     *
     * @date 2021-02-25 10:27:54
     */
    private Integer deleted;

    /**
     * 创建时间
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("created_at")
    @JsonProperty(value = "created_at")
    private LocalDateTime createdAt;

    /**
     * 删除时间
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("deleted_at")
    @JsonProperty(value = "deleted_at")
    private LocalDateTime deletedAt;

    /**
     * 更新时间
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("updated_at")
    @JsonProperty(value = "updated_at")
    private LocalDateTime updatedAt;

    @TableField(exist = false)
    @JsonIgnore
    private String tradeNo;


    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table get_red_packet_records
     *
     * @date 2021-02-25 10:27:54
     */
    private static final long serialVersionUID = 1L;

    /**
     * @date 2021-02-25 10:27:54
     */
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RedPacketRecordEntity other = (RedPacketRecordEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getRedPacketId() == null ? other.getRedPacketId() == null : this.getRedPacketId().equals(other.getRedPacketId()))
                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
                && (this.getRoomId() == null ? other.getRoomId() == null : this.getRoomId().equals(other.getRoomId()))
                && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
                && (this.getAmountRanking() == null ? other.getAmountRanking() == null : this.getAmountRanking().equals(other.getAmountRanking()))
                && (this.getPercent() == null ? other.getPercent() == null : this.getPercent().equals(other.getPercent()))
                && (this.getGiftType() == null ? other.getGiftType() == null : this.getGiftType().equals(other.getGiftType()))
                && (this.getExtension() == null ? other.getExtension() == null : this.getExtension().equals(other.getExtension()))
                && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
                && (this.getDeletedAt() == null ? other.getDeletedAt() == null : this.getDeletedAt().equals(other.getDeletedAt()))
                && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    /**
     * @date 2021-02-25 10:27:54
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRedPacketId() == null) ? 0 : getRedPacketId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getRoomId() == null) ? 0 : getRoomId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getAmountRanking() == null) ? 0 : getAmountRanking().hashCode());
        result = prime * result + ((getPercent() == null) ? 0 : getPercent().hashCode());
        result = prime * result + ((getGiftType() == null) ? 0 : getGiftType().hashCode());
        result = prime * result + ((getExtension() == null) ? 0 : getExtension().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getDeletedAt() == null) ? 0 : getDeletedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    /**
     * @date 2021-02-25 10:27:54
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", redPacketId=").append(redPacketId);
        sb.append(", userId=").append(userId);
        sb.append(", sourceId=").append(roomId);
        sb.append(", amount=").append(amount);
        sb.append(", amountRanking=").append(amountRanking);
        sb.append(", percent=").append(percent);
        sb.append(", giftType=").append(giftType);
        sb.append(", extension=").append(extension);
        sb.append(", deleted=").append(deleted);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", deletedAt=").append(deletedAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}